
<div id="section-title">
	<div class="wrapper">
		<div class="grid-25">
			<?php echo $html->link(__('+ Agregar producto', true), array('controller' => 'products', 'action' => 'dashboard_add'), array('class' => 'btn btn-big btn-blue right')); ?>
			<h1><?php __('Productos'); ?></h1>
		</div>
	</div>
</div>

<div id="body">
	<div class="wrapper">

		<div class="content products">
			<!--
			<div class="grid-9 module filter">
				<?php echo $form->input('Product.category', array('type' => 'select', 'options' => $categories, 'label' => __('Categoría', true), 'empty' => true, 'div' => false, 'label' => false)); ?>
			</div>
			-->
			
			<div class="grid-18">
			
				<div class="header">
					<span><?php __('Código'); ?></span>
					<span><?php __('Descripción'); ?></span>
					<!-- <span><?php //__('Familia'); ?></span> -->
					<span><?php __('Existencias/Minimo'); ?></span>
					<span><?php __('Precio'); ?></span>
				</div>
				
			<?php if(!empty($products)): ?>
				<ul class="list">
				<?php foreach($products AS $row): ?>
					<li>
						<div class="preview"><?php echo !empty($row[0]['preview']) ? $html->image($row[0]['preview']) : $html->link(__('Subir imagen', true), array()); ?></div>
						<div class="tools">
							<?php echo $html->link(__('Eliminar', true), array('controller' => 'products', 'action' => 'dashboard_delete', $row['Product']['id'], Security::hash($row['Product']['id'], 'md5', true))); ?> <?php echo $html->link(__('Editar', true), array('controller' => 'products', 'action' => 'dashboard_edit', $row['Product']['id'], Security::hash($row['Product']['id'], 'md5', true))); ?>
						</div>
						
						<h3>
							<?php echo $html->link($row['ProductDescription']['name'], array('controller' => 'products', 'action' => 'dashboard_details', $row['Product']['id'], Security::hash($row['Product']['id'], 'md5', true))); ?>
							<span class="code">
								<?php echo $row['Product']['code']; ?>
							</span>
						</h3>
						<p><em><?php echo $html->url(array('controller' => 'products', 'action' => 'details', $row['ProductDescription']['slug']), true); ?></em></p>
						<ul>
							<li>
								<label><?php __('Precio'); ?></label>
								<?php printf('%s %s', $row['Currency']['code'], $number->format($row['Product']['price'], array('before' => $row['Currency']['symbol_left'], 'after' => $row['Currency']['symbol_right'], 'places' => $row['Currency']['decimal_places'], 'decimals' => $row['Currency']['decimals'], 'thousands' => $row['Currency']['thousands'], 'escape' => false))); ?>
							</li>
						</ul>
						
						<span class="public-date"></span>
					</li>
				<?php endforeach; ?>
				</ul>
			<?php else: ?>
				<div class="message">
					<p><?php printf(__('En estos momentos no tienes productos publicados en tu tienda, solo debes presionar el botón de "%s", que se encuentra en el lado derecho y completar los campos necesarios para publicar tu producto.', true), $html->link(__('Nuevo Producto', true), array('controller' => 'products', 'action' => 'dashboard_add'))); ?>
				</div>
			<?php endif; ?>
			</div>
		</div>
	
	</div>
</div>


